package com.group3.entity;

import java.io.Serializable;
import java.util.UUID;

public class DishType implements Serializable {
	private String pId;// 菜品种类
	private String pname;// 种类名字

	public DishType() {
		super();
		this.pId = UUID.randomUUID().toString();
	}

	public DishType(String pname) {
		super();
		this.pId = UUID.randomUUID().toString();
		this.pname = pname;
	}

	public DishType(String pId, String pname) {
		super();
		this.pId = pId;
		this.pname = pname;
	}

	public String getpId() {
		return pId;
	}

	public void setpId(String pId) {
		this.pId = pId;
	}

	public String getPname() {
		return pname;
	}

	public void setPname(String pname) {
		this.pname = pname;
	}

	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((pId == null) ? 0 : pId.hashCode());
		result = prime * result + ((pname == null) ? 0 : pname.hashCode());
		return result;
	}

	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		DishType other = (DishType) obj;
		if (pId == null) {
			if (other.pId != null)
				return false;
		} else if (!pId.equals(other.pId))
			return false;
		if (pname == null) {
			if (other.pname != null)
				return false;
		} else if (!pname.equals(other.pname))
			return false;
		return true;
	}

	public String toString() {
		return "DishType [pId=" + pId + ", pname=" + pname + "]";
	}

}
